<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title>任务订单列表</title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<!-- Add by Kravis Liu 2014.09.22 -->
		<link rel="stylesheet" href="/css/base.css" />
		<link rel="stylesheet" href="/css/list2.css" />
		<script src="/js/jquery-1.11.1.min.js"></script>
		<script type="text/javascript">
			function updateOrderStatus(orderId, status){
				var dialogTitle = '';
				if(status == 0){
					dialogTitle = '是否驳回订单？';
				} else if (status == 1) {
					dialogTitle = '是否通过审核完成订单？';
				}
				
				if(confirm(dialogTitle)){
					$.ajax({
					   type: "POST",
					   url: "/app/updateOrderStatus",
					   data: "orderId=" + orderId + "&status=" + status,
					   success: function(msg){					   
						 if(msg == "success"){						
							alert('操作成功！');
						 } else {
							alert( msg );
						 }
						 
					   }
					});				
				}
			}
		</script>		
	</head>
	<body>
		<div>
			<div id="header">
				<h4>后台管理</h4>
			</div>

			<div align="center">				
				<% if(ImageFiles){ %>
					<%  ImageFiles.forEach(function (file){ %>	
						<label>
							<img id="image" src="<%=file.url()%>" />
						</label>
						</p>
				<% })}%>
			</div>
			<p>&nbsp;</p>
			
			<div id="footer">
				<a style="float:right;margin:5px" href="/logout">退出</a>
				<a style="float:right;margin:5px" href="/app/index">主页</a>
				<% if(Order){ %>
				<a style="float:right;margin:5px" align="center" href='javascript:void(0)' onClick='updateOrderStatus("<%= Order.id%>",0);'>驳回审核</a>								
				<a style="float:right;margin:5px" align="center" href='javascript:void(0)' onClick='updateOrderStatus("<%= Order.id%>",1);'>通过审核</a>								
				<%}%>				
			</div>
		</div>
	</body>
</html>
